package com.ming.cloudnote.controller.book;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ming.cloudnote.entity.Book;
import com.ming.cloudnote.service.BookService;
import com.ming.cloudnote.util.NoteResult;

@Controller
@RequestMapping("/book")
public class LoadBooksController {
	
	@Resource(name = "bookService")
	private BookService bookService;

	@ResponseBody
	@RequestMapping("/loadbooks")
	public NoteResult<List<Book>> execute(String userId) {
		return bookService.loadUserBooks(userId);
	}
}
